<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Oracle数据库核心技术指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
        }
        
        .section-title {
            position: relative;
            padding-left: 1rem;
        }
        
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .feature-icon {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        .table-custom {
            border-collapse: separate;
            border-spacing: 0;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.07);
        }
        
        .table-custom th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 600;
            padding: 1rem;
            text-align: left;
        }
        
        .table-custom td {
            padding: 1rem;
            border-bottom: 1px solid #e5e7eb;
        }
        
        .table-custom tr:last-child td {
            border-bottom: none;
        }
        
        .table-custom tr:hover {
            background-color: #f9fafb;
        }
        
        .scroll-indicator {
            position: fixed;
            top: 0;
            left: 0;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            z-index: 9999;
            transition: width 0.3s ease;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
    </style>
</head>
<body>
    <div class="scroll-indicator" id="scrollIndicator"></div>
    
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto animate-fadeInUp">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                <i class="fas fa-database mr-4"></i>
                Oracle数据库核心技术指南
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">
                深入掌握表管理、约束、事务、视图、序列与索引的精髓
            </p>
            <div class="flex flex-wrap gap-4">
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-book-open mr-2"></i>
                    完整教程
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-code mr-2"></i>
                    实战案例
                </div>
                <div class="bg-white bg-opacity-20 backdrop-blur-sm rounded-lg px-6 py-3">
                    <i class="fas fa-chart-line mr-2"></i>
                    性能优化
                </div>
            </div>
        </div>
    </section>
    
    <!-- Navigation -->
    <nav class="sticky top-0 bg-white shadow-md z-50">
        <div class="max-w-6xl mx-auto px-6 py-4">
            <div class="flex flex-wrap gap-4 justify-center">
                <a href="#table-management" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-table mr-1"></i>表管理
                </a>
                <a href="#constraints" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-lock mr-1"></i>约束
                </a>
                <a href="#transactions" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-exchange-alt mr-1"></i>事务
                </a>
                <a href="#views" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-eye mr-1"></i>视图
                </a>
                <a href="#sequences" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-sort-numeric-up mr-1"></i>序列
                </a>
                <a href="#indexes" class="text-gray-700 hover:text-purple-600 transition-colors">
                    <i class="fas fa-search mr-1"></i>索引
                </a>
            </div>
        </div>
    </nav>
    
    <!-- Main Content -->
    <main class="max-w-6xl mx-auto px-6 py-12">
        
        <!-- 表的创建与管理 -->
        <section id="table-management" class="mb-16 animate-fadeInUp">
            <h2 class="text-4xl font-bold mb-8 section-title">
                <i class="fas fa-table feature-icon mr-3"></i>
                表的创建与管理
            </h2>
            
            <div class="bg-white rounded-xl shadow-lg p-8 mb-8">
                <h3 class="text-2xl font-semibold mb-4">数据表的基本概念</h3>
                <p class="text-gray-700 leading-relaxed mb-6">
                    数据表是一种行与列数据的组合，也是数据库中最基本的组成单元。所有的数据操作（增加、修改、查询、删除）以及约束都要依附于数据表而存在。数据表可以理解为对现实或业务抽象的结果。
                </p>
                
                <h3 class="text-2xl font-semibold mb-4">Oracle常用数据类型</h3>
                <div class="overflow-x-auto">
                    <table class="table-custom w-full">
                        <thead>
                            <tr>
                                <th>类型</th>
                                <th>描述</th>
                                <th>示例</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td class="font-mono">CHAR(长度)</td>
                                <td>定长字符串类型</td>
                                <td>CHAR(10)</td>
                            </tr>
                            <tr>
                                <td class="font-mono">VARCHAR2(长度)</td>
                                <td>可变长字符串，可存放数字、字母</td>
                                <td>VARCHAR2(50)</td>
                            </tr>
                            <tr>
                                <td class="font-mono">NUMBER(长度)</td>
                                <td>数字类型</td>
                                <td>NUMBER(10,2)</td>
                            </tr>
                            <tr>
                                <td class="font-mono">DATE</td>
                                <td>日期类型（不包含毫秒）</td>
                                <td>SYSDATE</td>
                            </tr>
                            <tr>
                                <td class="font-mono">TIMESTAMP</td>
                                <td>时间戳（包含毫秒）</td>
                                <td>SYSTIMESTAMP</td>
                            </tr>
                            <tr>
                                <td class="font-mono">CLOB</td>
                                <td>大文本对象</td>
                                <td>用于存储文章</td>
                            </tr>
                            <tr>
                                <td class="font-mono">BLOB</td>
                                <td>二进制大对象</td>
                                <td>用于存储图片、视频</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-6">
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <h4 class="text-xl font-semibold mb-4">
                        <i class="fas fa-plus-circle text-green-500 mr-2"></i>
                        创建表
                    </h4>
                    <div class="code-block">
                        <pre>CREATE TABLE T_USER(
    id NUMBER(5),
    name VARCHAR2(20) DEFAULT '无名氏',
    age NUMBER(3),
    birthday DATE DEFAULT SYSDATE
);</pre>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <h4 class="text-xl font-semibold mb-4">
                        <i class="fas fa-copy text-blue-500 mr-2"></i>
                        复制表
                    </h4>
                    <div class="code-block">
                        <pre>-- 复制表结构和数据
CREATE TABLE myemp AS SELECT * FROM emp;

-- 只复制表结构
CREATE TABLE myemp AS SELECT * FROM emp WHERE 1=2;</pre>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- 数据库约束 -->
        <section id="constraints" class="mb-16 animate-fadeInUp">
            <h2 class="text-4xl font-bold mb-8 section-title">
                <i class="fas fa-lock feature-icon mr-3"></i>
                数据库约束
            </h2>
            
            <p class="text-gray-700 leading-relaxed mb-8">
                约束是保证用户对数据库所做的修改不会破坏数据的一致性，是保护数据正确性和相容性的一种手段。
            </p>
            
            <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-center">
                        <i class="fas fa-ban text-red-500"></i>
                    </div>
                    <h4 class="text-xl font-semibold mb-2">非空约束 (NOT NULL)</h4>
                    <p class="text-gray-600 mb-4">确保字段值不能为空</p>
                    <div class="code-block text-sm">
                        <pre>name VARCHAR2(200) NOT NULL</pre>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-center">
                        <i class="fas fa-fingerprint text-blue-500"></i>
                    </div>
                    <h4 class="text-xl font-semibold mb-2">唯一约束 (UNIQUE)</h4>
                    <p class="text-gray-600 mb-4">确保字段值不重复</p>
                    <div class="code-block text-sm">
                        <pre>email VARCHAR2(50) UNIQUE</pre>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-center">
                        <i class="fas fa-key text-yellow-500"></i>
                    </div>
                    <h4 class="text-xl font-semibold mb-2">主键约束 (PRIMARY KEY)</h4>
                    <p class="text-gray-600 mb-4">唯一标识每条记录</p>
                    <div class="code-block text-sm">
                        <pre>id NUMBER PRIMARY KEY</pre>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-center">
                        <i class="fas fa-check-circle text-green-500"></i>
                    </div>
                    <h4 class="text-xl font-semibold mb-2">检查约束 (CHECK)</h4>
                    <p class="text-gray-600 mb-4">自定义数据验证规则</p>
                    <div class="code-block text-sm">
                        <pre>age NUMBER CHECK(age BETWEEN 0 AND 200)</pre>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg p-6 card-hover">
                    <div class="text-3xl mb-4 text-center">
                        <i class="fas fa-link text-